<?php require 'Home/View/template/header.php'; ?>
<div class="container">
	<div class="row">
		<div class="list-group">
			<div class="page-header">
				<h2 class="text-center">我的房源</h2>
			</div>
			<br/>
			<table class="table table-hover">
				<tr  class="alert alert-info" role="alert">
					<th><span class="label label-primary">房屋地址</span></th>
					<th><span class="label label-success">房屋面积</span></th>
					<th><span class="label label-warning">房屋类型</span></th>
					<th><span class="label label-info">所在区域</span></th>
					<th><span class="label label-danger">状态</span></th>
					<th class="text-center" width='80'><span class="label label-success">图片</span></th>
					<th class="text-center"><span class="label label-default">操作</span></th>
				</tr>
				<?php
				foreach ($data as $row) {
					echo '<tr class="active">';
					echo '<td >'.$row['address'].'</td>';
					echo '<td >'.$row['area'].'平方米'.'</td>';
					echo '<td >'.$row['housetype'].'</td>';
					echo '<td>'.$row['region'].'</td>';
					if($row['issale']=='0') {
						echo '<td>未出租</td>';
					}else if ($row['issale']=='1') {
						echo '<td>已出租</td>';
					}else if ($row['issale']=='2') {
						echo '<td>未出售</td>';
					}else if ($row['issale']=='3') {
						echo '<td>已出售</td>';
					}
					echo '<td align="center"><img src=asset/images/'.$row['pic'].' width=60 height=80 alt="无头像"></td>';
					echo '<td class="text-center">';
					echo '<a href="index.php?c=house&m=houseeditform&id='.$row['id'].'">编辑</a> | ';
					echo '<a href="index.php?c=house&m=housedel&id='.$row['id'].'">删除</a>';
					echo '</td>';
					echo '</tr>';
				}
				echo '</table>';
				$totalrows = count($data);
				echo "<table align='center'><tr><td>共有{$totalrows}处房屋</td></tr></table>";
				?>
			</div>
		</div>
	</div>
	<?php require 'Home/View/template/footer.php'; ?>